package com.eies.business.dataprocess.adpter.remote.jms;

import com.eies.business.dataprocess.adpter.remote.jms.MessageHandler.AddThread;
import com.eies.business.dataprocess.adpter.remote.jms.MessageHandler.GetThread;

public class Test {

	public synchronized void getMessage(){
		System.out.println("getMsg");
	}
	public synchronized void putMessage(){
		System.out.println("putMsg");
		while(true){
			
		}
		
	}
	
	static class AddThread extends Thread {
		private Test mb;
		private String message = "";

		public AddThread(Test mb) {
			this.mb = mb;
		}

		public void run() {
			mb.putMessage();
		}

	}
	
	static class GetThread extends Thread {
		private Test mb;

		public GetThread(Test mb) {
			this.mb = mb;
		}

		public void run() {
			mb.getMessage();
		}
	}
	
	public static void main(String args[]) {
		try {
			Test mb = new Test();
			Thread add = new Thread(new AddThread(mb));
			Thread get = new Thread(new GetThread(mb));
			add.start();
			get.start();
		

		} catch (Exception e) {

		}
	}	
}
